package cn.edu.qlnu.xky.test.service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import cn.edu.qlnu.xky.test.common.Page;
import cn.edu.qlnu.xky.test.dao.BookDao;
import cn.edu.qlnu.xky.test.model.Book;
/**
 * 根据servlet传递的参数，进一步加工处理
 * 传递给dao层，这里不允许出现sql语句
 */
public class BookService {

	BookDao dao = null;
	public BookService() {
		dao = new BookDao();
	}
	public int addBook(Book b) {
		return dao.addBook(b);
	}
	
	public int editBook(Book b) {
		return dao.editBook(b);
	}
	public int deleteBook(int id) {
		return dao.deleteBook(id);
	}
	
	public Book searchById(int id) {
		return dao.searchById(id);
	}

	public int updateBookCount(int id, String type) {
		return dao.updateBookCount(id, type);
	}
	
	public Page<Book> searchByNamePage(String name,int pageNo){
		return dao.searchByBookNamePage(name,pageNo);
	}
	
	
}
